
import 'package:flutter/material.dart';

class IconItem extends StatelessWidget{
  final String title;
  final String? icon;

 const IconItem({
      Key?key,
      this.icon,
      this.title='标题',
 }):super(key:key);
  @override
  Widget build(BuildContext context) {
    // TODO: implement uild
    return FractionallySizedBox(
      widthFactor:0.25,
      child:Container(
        // color:Colors.red,
        padding:const EdgeInsets.fromLTRB(0, 10, 0, 10),
        child:Column(
          crossAxisAlignment:CrossAxisAlignment.center,
          children: [
          Image(image:NetworkImage(icon!),
            width:50,
            height:50,
            fit: BoxFit.cover,
          ),
          const SizedBox(height:6.5),
          Text(title,style:const TextStyle(color:Colors.black),),
        ],),
      )
    );
  }


}